<?php

namespace App\Http\Requests\Category;

use App\Http\Requests\Request;
use App\Http\Requests\RequestTrait;

class StoreRequest extends Request
{
    use RequestTrait;

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'parent_id' => 'required',
            'title' => 'required',
        ];
    }

    /**
     * Set custom messages for validator errors.
     *
     * @return array
     */
    public function messages()
    {
        return [
            'parent_id.required'  => '请选择上级类型',
            'title.required' => '请输入类型名称',
        ];
    }

}
